﻿var Game = {};

Game.fps = 30;

Game.initialize = function () {
    this.players = [];
    this.context = document.getElementById("GameCanvas").getContext("2d");
};

Game.draw = function () {
    var ctx = this.context;
    var img = new Image;
    img.src = 'http://localhost:30288/Images/SpriteSheets/004.png'; //Tiles SpriteSheet
    img.onload = function () {
        ctx.drawImage(img, 0, 0, 100, 100, -45, -45, 100, 100); 
    };

    for (var i = 0; i < this.players.length; i++) {
        this.players[i].draw(this.context);
    }
};

Game.update = function () {
    this.entities[0].update(this.context);
};

Game.addPlayer = function (x, y) {
    Game.players.push(new Character(x, y));
};
